# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=openimagedenoise
pkgver=2.3.0
pkgrel=0
pkgdesc="Intel Open Image Denoise library"
url="https://www.openimagedenoise.org/"
arch="aarch64 x86_64" # openimagedenoise only really supports these
license="Apache-2.0"
makedepends="cmake python3 onetbb-dev ispc samurai"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenImageDenoise/oidn/releases/download/v$pkgver/oidn-$pkgver.src.tar.gz"
builddir="$srcdir/oidn-$pkgver"
options="!check" # doesn't have a test suite

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_SKIP_RPATH=ON \
		-DOIDN_APPS=OFF

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4f68ce3b0da37e1861090d60d7cd823046f325c45a8e2c3f4098eb3b4f7ec676d2acbb9c138ff60a9f83188dd0dcbaba42106aad96beafc5e65045c77c00f2f8  openimagedenoise-2.3.0.tar.gz
"
